package com.beehoo.dcportal.action;

import java.util.List;

import com.beehoo.dcportal.common.base.BaseAction;
import com.beehoo.dcportal.common.base.BaseException;
import com.beehoo.dcportal.model.CommunityBean;
import com.beehoo.dcportal.model.MenuBean;
import com.beehoo.dcportal.service.ICommunityServ;

public class CommunityAction extends BaseAction{
	private static final long serialVersionUID = 5334385338781381834L;
	private List<CommunityBean> communityList;
	private ICommunityServ communityServ;
	private List<MenuBean> subMenuLs;
	
	public List<MenuBean> getSubMenuLs() {
		return subMenuLs;
	}

	public void setSubMenuLs(List<MenuBean> subMenuLs) {
		this.subMenuLs = subMenuLs;
	}

	public List<CommunityBean> getCommunityList() {
		return communityList;
	}

	public void setCommunityList(List<CommunityBean> communityList) {
		this.communityList = communityList;
	}

	public ICommunityServ getCommunityServ() {
		return communityServ;
	}

	public void setCommunityServ(ICommunityServ communityServ) {
		this.communityServ = communityServ;
	}

	@Override
	public String execute() throws Exception {
		try{
			setClickedMenu(paramMap.get("msgType"));
			
			communityList = communityServ.getcommunityList(paramMap.get("streetId"));
			subMenuLs = getSubMenuList(getCurrMenu().getMenuId());
		}catch (BaseException e) {
			setMessage(e.getMessage());
			return ERROR;
		}
		
		return SUCCESS;
	}
}
